package com.smart.wap.bodys;

import com.smart.manager.member.entities.views.MemberView;
import com.smart.manager.product.entities.views.BasicPigstyView;
import com.smart.manager.product.entities.views.BasicRfidView;
import com.smart.manager.product.entities.views.PigBreedView;
import com.smart.manager.product.entities.views.PigLevelView;
import com.smart.manager.work.views.BasicStaffView;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 投喂表单
 * @author Administrator
 */

@Data
public class PigBody {


    /**
     * 投喂表单
     * @author leo
     * @date 2023/10/05
     */
    @Data
    @Accessors(chain = true)
    public static class EditBody implements Serializable {

        @ApiModelProperty(value = "猪仔代码(操作猪仔必填)", required = true)
//        @NotBlank(message = "猪仔编号 不能为空")
//        @Length( max = 30,message = "猪仔代码 30个字符")
        private String pigCode;

        @ApiModelProperty("物品代码")
        @NotBlank(message = "物品代码 不能为空")
        @Length( max = 30,message = "物品代码 30个字符")
        private String snackCode;

        @ApiModelProperty("数量")
        @NotNull(message = "数量 不能为空")
        @Min(value = 1,message = "数量 不能小于1")
        private Integer number;

        @ApiModelProperty("备注(改名必填)")
        private String remark;

    }

    @Data
    @Accessors(chain = true)
    public static class CDKBody implements Serializable {

        @ApiModelProperty(value = "cdk兑换码", required = true)
        @NotBlank(message = "cdk兑换码 不能为空")
        private String cdk;
    }

    @Data
    @Accessors(chain = true)
    public static class NameBody implements Serializable {

        @ApiModelProperty(value = "猪仔代码", required = true)
        @NotBlank(message = "猪仔编号 不能为空")
        @Length( max = 30,message = "猪仔代码 30个字符")
        private String pigCode;

        @ApiModelProperty("名称")
        @NotBlank(message = "名称 不能为空")
        @Length( max = 30,message = "名称不能超过 30个字符")
        private String name;

    }




    @Data
    public static class ReturnBody implements Serializable {


        @ApiModelProperty("猪仔id")
        private Long id;

        @ApiModelProperty("猪仔名称")
        private String name;

        @ApiModelProperty("猪仔详情")
        private PigLevelView pigLevel;

        @ApiModelProperty("耳标MAC")
        private BasicRfidView rfid;

        @ApiModelProperty("所属玩家")
        private MemberView member;

        @ApiModelProperty("合养玩家")
        private MemberView closeMember;

        @ApiModelProperty("所属猪圈")
        private BasicPigstyView pigsty;

        @ApiModelProperty("猪仔档案")
        private PigBreedView breed;

        @ApiModelProperty("饲养员")
        private BasicStaffView staff;

    }
}
